<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../react18/react.development.js"></script>
    <script src="../react18/react-dom.development.js"></script>
    <script src="../react18/babel.min.js"></script>
    <style>
        .outer {
          width: 100px;
          height: 100px;
          background-color: rgb(116, 183, 145);
        }
      </style>
</head>
<body>
    <div id="app"></div>
    <script type="text/babel">
        //获取一个真实的DOM
        const oApp = document.getElementById("app")
        // console.dir(oApp,"真实DOM")

        //虚拟DOM本质就是Object类型的对象(一般对象)
        //虚拟DOM比较"轻",真实DOM比较"重",虚拟DOM是React内部在用,无需真实dom身上的诸多属性
        // 虚拟DOM会被React转为真实DOM呈现在页面上

        // 使用jsx方式创建DOM
        // const vDOM = <div> hello JSX</div>//不可以
        // console.log("虚拟DOM",vDOM);//打印一个对象

        const vDOM = (
            <div>
                <h1>JSX</h1>
                <p>JSX真好</p>
            </div>
        )

        //创建容器并渲染虚拟DOM
       
        ReactDOM.createRoot(document.getElementById("app")).render(vDOM)

    </script>
</body>
</html>